<?php

namespace app\admin\controller;

use app\cigoadmin\controller\backend\Demo;
use think\facade\Request;

class EditDemo extends Demo
{
    public function initialize()
    {
        header("Access-Control-Allow-Credentials", "true");  //这里不能使用逻辑值true，只能使用字符串true
        header("Access-Control-Allow-Origin", Request::header("Origin"));
        header("Access-Control-Allow-Headers", Request::header("Access-Control-Request->Headers"));
        header("Access-Control-Request-Method", Request::header("Access-Control-Request->Method"));
        parent::initialize(); // TODO: Change the autogenerated stub
    }

    public function select()
    {
        return $this->fetch('select');
    }

    public function getSelectDataList()
    {
        $this->success('', '', array(
            array('id' => '北京', 'text' => 'bj beijin 北京'),
            array('id' => '厦门', 'text' => 'xm xiamen 厦门'),
            array('id' => '福州', 'text' => 'fz fuzhou 福州')
        ));
    }

    public function innerTable()
    {

        return $this->fetch();
    }
}
